home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 620 / text0000.txt < prev   
Encoding:
Text File  |  1996-08-05  |  542 b   |  19 lines

  1. In a message of 07 Jan 96 Gene Heskett wrote to All:
  2.  
  3.  Y>>    if ( tmpbuf[0] & 0x1f == 1 )
  4.  
  5.  GH> Well, while your code *may* be legal, I think what you wanted was:
  6.  
  7.  GH>        if ( (tmpbuf[0] & 0x1f) == 1 )
  8.  
  9.  GH> which could be simplified to:
  10.  
  11.  GH>        if (tmpbuf[0] & 0x01)
  12.  
  13. The two statements are different.. If tmpbuf[0] contained 0x11, the original
  14. statement is not satisfied (0x11 & 0x1f is 0x11, not 1) but the second
  15. statement is satisfied (0x11 & 0x01 is 0x01).
  16.  
  17. .\dam.          [Team AMIGA]          //\ ad32@brighton.ac.uk \\/
  18.  
  19.